//
//  LYQDemoViewController.swift
//  SwiftWeibo
//
//  Created by 刘英群 on 2016/12/25.
//  Copyright © 2016年 刘英群. All rights reserved.
//

import UIKit

class LYQDemoViewController: LYQBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置标题
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }

    @objc fileprivate func showNext(){
        
        let vc = LYQDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension LYQDemoViewController {
    
    override func setupTableView() {
        super.setupTableView()
        //设置右侧控制器
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}

// navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        let btn: UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
